Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[C&P] Fix Unbonding slashed suppliers #891

Merged
merged 2 commits into from
Oct 23, 2024

Conversation

red-0ne
Copy link
Contributor

@red-0ne red-0ne commented Oct 22, 2024

Summary

This PR fixes a few bugs that were dependent to each other:

  1. Gracefully unbond suppliers that have 0upokt due to off-stake slashing.
  2. Fix access to an expired session tree on the realy miner
  3. Fix proof block hash seed used on chain.

@okdas , One case I didn't manage to reproduce is having the application module account go to 0. Please tell me if you encounter it again.

Issue

Type of change

Select one or more from the following:

Testing

  • Documentation: make docusaurus_start; only needed if you make doc changes
  • Unit Tests: make go_develop_and_test
  • LocalNet E2E Tests: make test_e2e
  • DevNet E2E Tests: Add the devnet-test-e2e label to the PR.

Sanity Checklist

  • I have tested my changes using the available tooling
  • I have commented my code
  • I have performed a self-review of my own code; both comments & source code

@red-0ne red-0ne added bug Something isn't working relayminer Changes related to the Relayminer tokenomics Token Economics - what else do you need? proof Claim & Proof life cycle labels Oct 22, 2024
@red-0ne red-0ne added this to the Shannon Beta TestNet Launch milestone Oct 22, 2024
@red-0ne red-0ne self-assigned this Oct 22, 2024
Copy link
Member

@okdas okdas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you SO MUCH! ❤️

Once this is merged, I'll try to do more load testing shortly to see if we can break the network again.

I'll wait for more input from @Olshansk or @bryanchriswhite — I'm not comfortable signing for such changes yet. 😅

@@ -273,8 +273,10 @@ func (st *sessionTree) Delete() error {
// This was intentionally removed to lower the IO load.
// When the database is closed, it is deleted it from disk right away.

if err := st.treeStore.Stop(); err != nil {
return err
if st.treeStore != nil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add an error log if treeStore == nil?
I think it would be helpful if this condition is reached for whatever reason in the future.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Copy link
Contributor

@bryanchriswhite bryanchriswhite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Preemptively approving. A couple of comments but otherwise, nice solve! 🙌

x/proof/keeper/msg_server_submit_proof.go Show resolved Hide resolved
x/supplier/keeper/unbond_suppliers.go Show resolved Hide resolved
Copy link
Member

@Olshansk Olshansk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple comments but no blockers. LGTM!

@@ -273,8 +273,10 @@ func (st *sessionTree) Delete() error {
// This was intentionally removed to lower the IO load.
// When the database is closed, it is deleted it from disk right away.

if err := st.treeStore.Stop(); err != nil {
return err
if st.treeStore != nil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

x/proof/keeper/msg_server_submit_proof.go Show resolved Hide resolved
x/supplier/keeper/unbond_suppliers.go Show resolved Hide resolved
Copy link

The CI will now also run the e2e tests on devnet, which increases the time it takes to complete all CI checks.

You may need to run make trigger_ci to submit an empty commit that'll trigger the tests.

GCP workloads (requires changing the namespace to 891)
Grafana network dashboard for devnet-issue-891

@github-actions github-actions bot added devnet push-image CI related - pushes images to ghcr.io labels Oct 23, 2024
@red-0ne red-0ne merged commit 0663679 into main Oct 23, 2024
10 checks passed
okdas pushed a commit that referenced this pull request Nov 14, 2024
## Summary

This PR fixes a few bugs that were dependent to each other:
1. Gracefully unbond suppliers that have 0upokt due to off-stake
slashing.
2. Fix access to an expired session tree on the realy miner
3. Fix proof block hash seed used on chain.

@okdas , One case I didn't manage to reproduce is having the application
module account go to `0`. Please tell me if you encounter it again.

## Issue

- #841 

## Type of change

Select one or more from the following:

- [ ] New feature, functionality or library
- [ ] Consensus breaking; add the `consensus-breaking` label if so. See
#791 for details
- [x] Bug fix
- [ ] Code health or cleanup
- [ ] Documentation
- [ ] Other (specify)

## Testing

- [ ] **Documentation**: `make docusaurus_start`; only needed if you
make doc changes
- [x] **Unit Tests**: `make go_develop_and_test`
- [x] **LocalNet E2E Tests**: `make test_e2e`
- [ ] **DevNet E2E Tests**: Add the `devnet-test-e2e` label to the PR.

## Sanity Checklist

- [x] I have tested my changes using the available tooling
- [x] I have commented my code
- [x] I have performed a self-review of my own code; both comments &
source code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working devnet devnet-test-e2e proof Claim & Proof life cycle push-image CI related - pushes images to ghcr.io relayminer Changes related to the Relayminer tokenomics Token Economics - what else do you need?
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

4 participants